package io.wongd.lib_douyin.util

import android.content.ClipboardManager
import android.content.Context

object ClipUtil {
    @JvmStatic
    fun getClipboardData(context: Context): String? {
        val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        val clipData = clipboard.primaryClip
        if (clipData != null && clipData.itemCount > 0) {
            val text = clipData.getItemAt(0).text
            return text.toString()
        }
        return null
    }
}